<template>
  <div>
    <XqForm :form="form" :customize="formConfig['customize']">
      <a-row>
        <template v-for="key in fieldKeys">
          <a-col v-if="showItem(key)" :key="key" :span="formSpan">
            <XqItem
              :form="form"
              :dataSource="dataSource"
              :dynamicData="dynamicData"
              :item="formatFormField(formFields[key])"
              :validator="getValidator(key)"
              :editable="true"
              @search="onSearch"
            />
          </a-col>
        </template>
      </a-row>
    </XqForm>
  </div>
</template>
<script>
import XqFormMixin from "xqjr-plugin-form/mixins/XqFormMixin";

const FormMixin = new XqFormMixin();

export default {
  name: "",
  mixins: [FormMixin],
  props: {
    showAll: {
      type: Boolean,
      default: true
    },
    formSpan: {
      type: Number,
      default: 24
    },
    searchSpan: {
      type: Number,
      default: 6
    }
  },
  data() {
    return {};
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    onSearch() {
      if (this.mode === "search") {
        this.$emit("search");
      }
    }
  }
};
</script>
<style lang="scss">
.ant-advanced-search-form {
  .ant-form-item {
    display: flex;
  }
  .ant-form-item-control-wrapper {
    flex: 1;
  }
}
</style>
